﻿	function submitdoc(htmllist){

	     	var html ;
		if(keyval=="雪场"){
	     	for ( var i = 0; i < htmllist.length; i++) {

				if($("#searchkey").val() == htmllist[i].label){
					html = htmllist[i].homepage;
					break;
				}
				}
			if(html!=undefined||html!=null){
	               // window.location.href=html;
			$("#searchform").attr("action",html);
			return true;
	
			}else{
				$("#searchform").attr("action","http://search.51ski.com/index.jsp");
//window.location.href="http://www.51ski.com/";
				return true;
			}
			}else{
				$("#searchform").attr("action","http://search.51ski.com/index.jsp");
				return true;
			}
	}

    function newsearch(){
    	
		if($.trim($("#searchkey").val()) == "请输入搜索内容" ||$.trim($("#searchkey").val()) == "请输入雪场关键词" ||  $.trim($("#searchkey").val()) == ""){
			alert("请输入关键字后搜索！");
			$("#searchform").attr("target","_self")
			return false;
 		}else{
			//alert("请输入关键字后搜索！");
			submitdoc(htmllist);
		}
    }